package com.usefullc.crawler.task;

import java.util.List;

/**
 * @author: Sampson
 * @date: 2022-03-27 16:33
 */
public interface TaskMessageQueue<T> {

  void addTaskMessage(TaskMessage<T> taskMessage);

  TaskMessage<T> popTaskMessage(boolean block);

  /**
   * 推出多个消息
   * @param block
   * @return
   */
  List<TaskMessage<T>> popTaskMultiMessage(boolean block);

  List<TaskMessage<T>> popTaskMultiMessage(Long taskId);


//  List<TaskMessage> popTaskMessages(String reqType,int length);
//
//  void commit(String reqType);
//
//  void commit(String reqType,int offset);

}
